package LimitedTimeGame.Day_0326.night;

import java.util.Scanner;

/**
 * @author zxc
 * @date 2023/03/26 21:11
 **/
public class Multipy {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        int target = 0;
        for(int i = 0 ; i < n ; i++){
            arr[i] = scanner.nextInt();
            target ^= arr[i];
        }
//        System.out.println(target);
        System.out.println(isEqual(target, n, arr));
    }
    public static int isEqual(int target , int n , int[] arr){
        int result = 0;
        for(int i = 0 ; i < n ; i++){
            for(int j = n - i ; j >= 1 ; j--){
                long sum = 1;
                for(int k = i ; k < i + j ; k++){
                    sum *= arr[k];
                    if(sum > target){
                        break;
                    }
                }
                if(sum == target){
                    result++;
                }
                if(sum < target){
                    break;
                }
            }
        }
        return result;
    }
}
